package br.com.lambdacore.persistence.entitymodel.impl;

import javax.persistence.MappedSuperclass;

import br.com.lambdacore.lang.EqualsBuilder;
import br.com.lambdacore.lang.HashCodeBuilder;
import br.com.lambdacore.lang.ToStringBuilder;
import br.com.lambdacore.model.EntityModel;

@MappedSuperclass
public abstract class ModelPersistence<PK> implements EntityModel<PK> {

	private static final long serialVersionUID = -1846732087501408797L;

	@Override
	public boolean equals(Object object) {
		return EqualsBuilder.newInstance(this).equals(object);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.newInstance(this).hashCode();
	}

	@Override
	public String toString() {
		return ToStringBuilder.newInstance(this).toString();
	}

}
